#include <cstdio>
#include <math.h>

using namespace std;

int M, N;
int size = 1;
//最大为第10000个素数,所以数组长度需要满足条件
int prime[150005] = {0};

bool isPrime(int x){
    if(x == 2 || x == 3){
        return true;
    }

    if(x % 2 == 0){
        return false;
    }
    
    for(int i = 3; i <= sqrt(x); i++){
        if(x % i == 0){
            return false;
        }
    }
    return true;
}

void before(){
    for(int i = 2; i < 150005; i++){
        if(isPrime(i)){
            prime[size++] = i;
        }
    }
}

void printPrime(int M, int N){
    int line = 0, i = 0;
    for(i = M; i <= N; i++){
        printf("%s%d", !line?"":" ", prime[i]);
        line++;
        if(line == 10){ printf("\n"); line = 0; }
    }
}

int main()
{
    before();
    scanf("%d %d", &M, &N);
    printPrime(M, N);
}
